
class Singleton{
    private static Singleton singleton=new Singleton();

    public static Singleton getSingleton(){
        return singleton;
    }

    private Singleton(){

    }
}

public class Demo1 {
    public static void main(String[] args) {
        Singleton t1=Singleton.getSingleton();
        Singleton t2=Singleton.getSingleton();
        System.out.println(t1==t2);
    }
}
